<?php
namespace App\Services\IntegralOrder;

use App\Services\ProjectValidate;
/**
 * 订单模块验证规则集合
 *
 * Class ValidateOrder
 */
class ValidateOrder extends ProjectValidate
{
    /**
     * 自定义子类初始化
     * @param array $initData
     * @return mixed
     */
    public function initValidate($initData = [])
    {
//        if (!empty($initData['c_id'])) {
//            $this->rules['c_id']  = 'numeric|min:0';
//        }

    }
    
    public $rules = [
        'id'                     => 'int|min:1',
        'user_id'                => 'int|min:1',
        'order_id'               => 'int|min:1',
        'goods_id'               => 'int|min:1',
        'number'                 => 'int|min:1',
        'integral'               => 'int|min:1',
        'order_code'             => 'min:2',
        'pick_up_code'           => 'min:2',
        'name'                   => 'min:2',
        'logistics_company_code' => 'alpha_num',
        'waybill_number'         => 'alpha_num',
        'logistics_company_name' => 'min:2',
        'page'                   => 'int|min:1',
        'listRows'               => 'integer|min:1|max:100'
    ];

   
    public $messages = [
       
    ];

    /**
     * @var array 上面规则中定义的 key 的名字
     */
    public $attributes = [
      
    ];
}